<template>
  <el-container>
    <el-header>
      <div style="margin-top:5px">
        <img
          src="@/assets/css/images/lesson.svg"
          alt=""
          style=" width: 45px;height: 45px;vertical-align:middle; overflow-x: hidden;margin-left:15px"
        />
        <b> 网课资源</b>
      </div>
    </el-header>
    <el-main>
      <el-card class="card">
        <el-breadcrumb separator="|" style="margin-top:1%">
          <el-breadcrumb-item :to="{ path: '/recent' }"
            >全部</el-breadcrumb-item
          >
          <el-breadcrumb-item :to="{ path: '/system/lessen/onlineStudy/video' }"
            >校内学习</el-breadcrumb-item
          >
          <el-breadcrumb-item>即将开始</el-breadcrumb-item>
          <el-breadcrumb-item>已经结束</el-breadcrumb-item>
        </el-breadcrumb>
        <el-carousel
          trigger="click"
          height="80vh"
          style="background-color:white"
        >
          <el-carousel-item>
            <el-row>
              <el-col :span="8" v-for="item in card1" :key="item">
                <div class="container">
                  <!-- <el-card id="container" :body-style="{ padding: '0px' }"> -->
                  <img
                    :src="item.img"
                    id="img"
                    @click="open(item.path)"
                    class="wow flipInX"
                  />
                  <!-- </el-card> -->
                </div>
              </el-col>
            </el-row>
          </el-carousel-item>
          <el-carousel-item>
            <el-row>
              <el-col :span="8" v-for="item in card2" :key="item">
                <div class="container">
                  <!-- <el-card id="container" :body-style="{ padding: '0px' }"> -->
                  <img
                    :src="item.img"
                    id="img"
                    @click="open(item.path)"
                    class="wow flipInX"
                  />
                  <!-- </el-card> -->
                </div>
              </el-col>
            </el-row>
          </el-carousel-item>
          <el-carousel-item>
            <el-row>
              <el-col :span="8" v-for="item in card3" :key="item">
                <div class="container">
                  <!-- <el-card id="container" :body-style="{ padding: '0px' }"> -->
                  <img
                    :src="item.img"
                    id="img"
                    @click="open(item.path)"
                    class="wow flipInX"
                  />
                  <!-- </el-card> -->
                </div>
              </el-col>
            </el-row>
          </el-carousel-item>
        </el-carousel>
      </el-card>
    </el-main>
  </el-container>
</template>

<script>
import lessenApi from "../lessen/onlineStudy/lessenApi";
export default {
  data() {
    return {
      headName: "",
      card1: lessenApi.cardListrow1.slice(0, 6),
      card2: lessenApi.cardListrow1.slice(7, 12),
      card3: lessenApi.cardListrow1.slice(13, 17),
    };
  },
  created() {
    if (localStorage.getItem("teamName")) {
      this.headName = localStorage.getItem("teamName");
      // localStorage.clear();
    }
  },
  mounted() {
    new this.$wow.WOW().init();
  },
  created() {
    // this.getLessonList()
  },
  methods: {
    //获取网课列表
    async getLessonList() {
      //TODO api修改
      const { res: data } = this.$http.get("/Lesson", this.cardListrow1);
    },

    // 跳转
    open(url) {
      // console.log(url);
      window.open(url);
      // setTimeout(() => {
      //   this.detailDialog = true
      // }, 200);
    },
  },
};
</script>

<style lang="less" scoped>
.el-header {
  border-radius: 10px;
  background-color: white;
  color: rgb(8, 8, 8);
}
.el-main {
  height: 100vh;
  background-color: rgb(243, 243, 243);
}
.card {
  border-radius: 10px;
  height: auto;
  margin-top: 10px;
  width: 90%;
  margin-left: 5%;
}

.bottom {
  margin-top: 13px;
  line-height: 12px;
}

#img {
  width: 60%;
  height: 65%;
  display: block;
  margin-bottom:20px;
  cursor: pointer;
}
.container {
  margin-top: 20%;
  margin-left: 25%;
  transition: all 0.5s;
  transform-style: preserve-3d;
}
.face,
.back {
  // position: absolute;
  backface-visibility: hidden;
}
.face {
  z-index: 1;
  background-color: antiquewhite;
}
.back {
  transform: rotateY(180deg);
  background-color: aqua;
}
.el-carousel__item {
  color: white;
  font-size: 14px;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
}
#container {
  border-radius: 10px;
  margin-right: 8%;
  margin-left: 8%;
  margin-top: 8%;
  width: 80% !important;
}
</style>
